<?php TPL::output('admin/global/header.tpl.htm'); ?>
<?php TPL::output('admin/global/nav_menu.tpl.htm'); ?>

<div class="aw-content-wrap" id="tools">
    <div class="mod">
        <div class="mod-head">
            <h3>
                <span class="pull-left"><?php _e('系统维护'); ?></span>
            </h3>
        </div>

        <div class="tab-content mod-content">
            <table class="table table-striped">
            <tbody>
            <tr>
                <td>
                    <form action="admin/tools/init/" method="post">
                        <input type="hidden" name="action" value="cache_clean" />
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('缓存清理'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('当站点进行了数据恢复、升级或者工作出现异常的时候, 你可以使用本功能清除缓存'); ?>
                            </div>
                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>
            <tr>
                <td>
                    <form action="admin/tools/email_setting_test/" method="post" id="email_setting_test_form" onsubmit="return false">
                    <div class="form-group">
                        <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('邮件系统测试'); ?>:</span>
                        <div class="col-sm-7 col-xs-8 middle">
                            <?php _e('使用此功能测试邮件系统配置是否正确'); ?>
                            <div class="row">
                                <span class="col-sm-1 mod-text-inline"><?php _e('&nbsp 收件人地址'); ?>:</span>
                                <div class="col-sm-6">
                                    <input class="form-control" type="text" name="test_email" />
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-2 col-xs-12">
                            <input type="button" class="btn btn-primary" onclick="AWS.ajax_post($('#email_setting_test_form'));" value="<?php _e('开始处理'); ?>">
                        </div>
                    </div>
                    </form>
                </td>
            </tr>

            <tr>
                <td>
                    <form action="admin/tools/init/" method="post" target="_blank">
                        <input type="hidden" name="action" value="update_question_search_index" />

                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('更新问题搜索索引'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('如果站点搜索功能有问题可以使用此功能修正'); ?>

                                <div class="row">
                                    <span class="col-sm-1 mod-text-inline"><?php _e('&nbsp 每次处理数量'); ?>:</span>
                                    <div class="col-sm-6">
                                        <input type="text" value="300" name="per_page" class="form-control" />
                                    </div>
                                </div>
                            </div>

                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>

            <tr>
                <td>
                    <form action="admin/tools/init/" method="post" target="_blank">
                        <input type="hidden" name="action" value="update_article_search_index" />

                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('更新文章搜索索引'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('如果站点搜索功能有问题可以使用此功能修正'); ?>

                                <div class="row">
                                    <span class="col-sm-1 mod-text-inline"><?php _e('&nbsp 每次处理数量'); ?>:</span>
                                    <div class="col-sm-6">
                                        <input type="text" value="300" name="per_page" class="form-control" />
                                    </div>
                                </div>
                            </div>

                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>

            <?php if (check_extension_package('project')) { ?>
            <tr>
                <td>
                    <form action="admin/tools/init/" method="post" target="_blank">
                        <input type="hidden" name="action" value="update_project_posts_index" />

                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('更新活动搜索索引'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('如果站点搜索功能有问题可以使用此功能修正'); ?>

                                <div class="row">
                                    <span class="col-sm-1 mod-text-inline"><?php _e('&nbsp 每次处理数量'); ?>:</span>
                                    <div class="col-sm-6">
                                        <input type="text" value="300" name="per_page" class="form-control" />
                                    </div>
                                </div>
                            </div>

                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>
            <?php } ?>

            <tr>
                <td>
                    <form action="admin/tools/init/" method="post" target="_blank">
                        <input type="hidden" name="action" value="update_fresh_actions" />

                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('更新最新动态'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('如果站点最新动态数据有问题可以使用此功能修正'); ?>

                                <div class="row">
                                    <span class="col-sm-1 mod-text-inline"><?php _e('&nbsp 每次处理数量'); ?>:</span>
                                    <div class="col-sm-6">
                                        <input type="text" value="2000" name="per_page" class="form-control" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>

            <tr>
                <td>
                    <form action="admin/tools/init/" method="post" target="_blank">
                        <input type="hidden" name="action" value="update_users_reputation" />
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('更新用户威望'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('威望数据一般情况下会自动更新, 如果更改了威望设置需要立即生效可以使用此工具'); ?>

                                <div class="row">
                                    <span class="col-sm-1 mod-text-inline"><?php _e('&nbsp 每次处理数量'); ?>:</span>
                                    <div class="col-sm-6">
                                        <input type="text" value="500" name="per_page" class="form-control" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>

            <tr>
                <td>
                    <form action="admin/tools/init/" method="post" target="_blank">
                        <input type="hidden" name="action" value="update_topic_discuss_count" />
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('更新话题统计'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('话题统计数据一般情况下会自动更新, 如果需要使统计立即生效可以使用此工具'); ?>

                                <div class="row">
                                    <span class="col-sm-1 mod-text-inline"><?php _e('&nbsp 每次处理数量'); ?>:</span>
                                    <div class="col-sm-6">
                                        <input type="text" value="500" name="per_page" class="form-control" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>

            <tr>
                <td>
                    <form action="admin/tools/init/" method="post" target="_blank">
                        <input type="hidden" name="action" value="bbcode_to_markdown" />
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('BBCode 转换'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('此工具可以将系统内容中的 BBCode 语法转换为 Markdown 语法'); ?>

                                <div class="row">
                                    <span class="col-sm-1 mod-text-inline"><?php _e('&nbsp 每次处理数量'); ?>:</span>
                                    <div class="col-sm-6">
                                        <input type="text" value="500" name="per_page" class="form-control" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>

            <tr>
                <td>
                    <form action="admin/tools/init/" method="post" target="_blank">
                        <input type="hidden" name="action" value="markdown_to_bbcode" />
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('Markdown 转换'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('此工具可以将系统内容中的 Markdown 语法转换为 BBCode 语法'); ?>

                                <div class="row">
                                    <span class="col-sm-1 mod-text-inline"><?php _e('&nbsp 每次处理数量'); ?>:</span>
                                    <div class="col-sm-6">
                                        <input type="text" value="500" name="per_page" class="form-control" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>

            <tr>
                <td>
                    <form action="admin/tools/init/" method="post" target="_blank">
                        <input type="hidden" name="action" value="update_weixin_menu" />
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label middle"><?php _e('更新微信菜单'); ?>:</span>
                            <div class="col-sm-7 col-xs-8 middle">
                                <?php _e('此工具可以读取系统中的微信配置并提交给微信公众平台, 使用前请确认菜单已经配置好, 并且有菜单权限'); ?>
                            </div>
                            <div class="col-sm-2 col-xs-12">
                                <input type="submit" class="btn btn-primary" value="<?php _e('开始处理'); ?>">
                            </div>
                        </div>
                    </form>
                </td>
            </tr>
            </tbody>
            </table>
        </div>
    </div>
</div>

<?php TPL::output('admin/global/footer.tpl.htm'); ?>
